package com.oig.sys.msg.dao;

import com.oig.sys.msg.entity.TbPushChannel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface ITbPushChannelDao extends JpaRepository<TbPushChannel, Long> {

    @Query("from TbPushChannel t where t.id=:id")
    TbPushChannel getChannelById(@Param("id") Integer id);

    @Query("from TbPushChannel t where t.tenantId=:tenantId and t.supportMsgType=:supportMsgType and t.status =:code")
    List<TbPushChannel> findByStatus(@Param("tenantId") Integer tenantId,@Param("supportMsgType") String supportMsgType, @Param("code") String code);
}
